Optimal. Leaf size=70 \[ x \left (a^2 B+2 a A b-b^2 B\right )+\frac{a^2 A \log (\sin (c+d x))}{d}-\frac{b (2 a B+A b) \log (\cos (c+d x))}{d}+\frac{b^2 B \tan (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.11392, antiderivative size = 70, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.103, Rules used = {3606, 3624, 3475} \[ x \left (a^2 B+2 a A b-b^2 B\right )+\frac{a^2 A \log (\sin (c+d x))}{d}-\frac{b (2 a B+A b) \log (\cos (c+d x))}{d}+\frac{b^2 B \tan (c+d x)}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3606
Rule 3624
Rule 3475
Rubi steps
\begin{align*} \int \cot (c+d x) (a+b \tan (c+d x))^2 (A+B \tan (c+d x)) \, dx &=\frac{b^2 B \tan (c+d x)}{d}+\int \cot (c+d x) \left (a^2 A+\left (2 a A b+\left (a^2-b^2\right ) B\right ) \tan (c+d x)+\left (A b^2+2 a b B\right ) \tan ^2(c+d x)\right ) \, dx\\ &=\left (2 a A b+a^2 B-b^2 B\right ) x+\frac{b^2 B \tan (c+d x)}{d}+\left (a^2 A\right ) \int \cot (c+d x) \, dx+(b (A b+2 a B)) \int \tan (c+d x) \, dx\\ &=\left (2 a A b+a^2 B-b^2 B\right ) x-\frac{b (A b+2 a B) \log (\cos (c+d x))}{d}+\frac{a^2 A \log (\sin (c+d x))}{d}+\frac{b^2 B \tan (c+d x)}{d}\\ \end{align*}
Mathematica [C] time = 0.288218, size = 93, normalized size = 1.33 \[ -\frac{-2 a^2 A \log (\tan (c+d x))+(a+i b)^2 (A+i B) \log (-\tan (c+d x)+i)+(a-i b)^2 (A-i B) \log (\tan (c+d x)+i)-2 b B (a+b \tan (c+d x))}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.062, size = 109, normalized size = 1.6 \begin{align*} 2\,Axab+{a}^{2}Bx-{b}^{2}Bx-{\frac{A{b}^{2}\ln \left ( \cos \left ( dx+c \right ) \right ) }{d}}+{\frac{{a}^{2}A\ln \left ( \sin \left ( dx+c \right ) \right ) }{d}}+2\,{\frac{Aabc}{d}}+{\frac{{b}^{2}B\tan \left ( dx+c \right ) }{d}}-2\,{\frac{Bab\ln \left ( \cos \left ( dx+c \right ) \right ) }{d}}+{\frac{B{a}^{2}c}{d}}-{\frac{B{b}^{2}c}{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.48323, size = 115, normalized size = 1.64 \begin{align*} \frac{2 \, A a^{2} \log \left (\tan \left (d x + c\right )\right ) + 2 \, B b^{2} \tan \left (d x + c\right ) + 2 \,{\left (B a^{2} + 2 \, A a b - B b^{2}\right )}{\left (d x + c\right )} -{\left (A a^{2} - 2 \, B a b - A b^{2}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.06469, size = 217, normalized size = 3.1 \begin{align*} \frac{A a^{2} \log \left (\frac{\tan \left (d x + c\right )^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) + 2 \, B b^{2} \tan \left (d x + c\right ) + 2 \,{\left (B a^{2} + 2 \, A a b - B b^{2}\right )} d x -{\left (2 \, B a b + A b^{2}\right )} \log \left (\frac{1}{\tan \left (d x + c\right )^{2} + 1}\right )}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 1.41, size = 129, normalized size = 1.84 \begin{align*} \begin{cases} - \frac{A a^{2} \log{\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac{A a^{2} \log{\left (\tan{\left (c + d x \right )} \right )}}{d} + 2 A a b x + \frac{A b^{2} \log{\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + B a^{2} x + \frac{B a b \log{\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{d} - B b^{2} x + \frac{B b^{2} \tan{\left (c + d x \right )}}{d} & \text{for}\: d \neq 0 \\x \left (A + B \tan{\left (c \right )}\right ) \left (a + b \tan{\left (c \right )}\right )^{2} \cot{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.34912, size = 116, normalized size = 1.66 \begin{align*} \frac{2 \, A a^{2} \log \left ({\left | \tan \left (d x + c\right ) \right |}\right ) + 2 \, B b^{2} \tan \left (d x + c\right ) + 2 \,{\left (B a^{2} + 2 \, A a b - B b^{2}\right )}{\left (d x + c\right )} -{\left (A a^{2} - 2 \, B a b - A b^{2}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]